import { Button } from "antd-mobile";
import { Link, useNavigate } from "react-router-dom";

function Login() {
  const navigate = useNavigate();
  return (
    <div className="App">
      <h1>登录</h1>
      <h2>声明式</h2>
      <Link to="/acticle">声明式-去文章</Link>
      <h2>编程式</h2>
      <button onClick={() => navigate("/acticle/1001?id=100&name=jack")}>
        编程式-去文章
      </button>
      <button onClick={() => navigate("/acticle?id=100&name=jack")}>
        编程式-去文章
      </button>
      <button
        onClick={() =>
          navigate("/acticle?id=100&name=jack", {
            state: { id: "123456" },
            replace: true,
          })
        }
      >
        编程式-去文章
      </button>
      <Button color="primary">测试全局</Button>
      <div className="puple">
        <Button color="primary">测试局部</Button>
      </div>
    </div>
  );
}

export default Login;
